<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>JS中有四种对象</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body>
  
  
	<script type="text/javascript">
		
		//Date
		//var nowStr = new Date().toLocaleString();
		//window.document.write(nowStr + "<br/>");	
		
		
		//Math
		//for(var i=1;i<=10;i++){
		//	//1到9之间的随机整数
		//	document.write(Math.floor(Math.random()*9)+1 + "<br/>");
		//}
		
		
		//string
		//var str = "Hello你好";
		//var size = str.length; 
		//alert(size);//7
		
		
		//Array
		//var array = new Array("语文","数学","英语",true,123);
		//for(var i=0;i<array.length;i++){
		//	document.write(array[i] + "   ");
		//}
		
	</script>
	
	<script type="text/javascript">
		/*自定义对象
		function Person(id,name,sal){
			this.id = id;
			this.name = name;
			this.sal = sal;
		}
		var p = new Person(1,"波波",7000);
		document.write("编号:" + p.id + "<br/>");
		document.write("姓名:" + p.name + "<br/>");
		document.write("薪水:" + p.sal + "<br/>");
		*/
	</script>
	
	<script type="text/javascript">
		//window对象，打开新窗口
		//var url = "04_images.html";
		//window.open(url);			
	</script>
	
	<script type="text/javascript">
		//status对象，将当前时间设置到状态栏中
		//var nowStr = new Date().toLocaleString();
		//window.status = nowStr;
	</script>
	
	<script type="text/javascript">
		//location对象，模拟用户在地址栏输入url访问其它页面的情况
		//var url = "04_images.html";
		//window.location.href = url;
	</script>
	
	<script type="text/javascript">
		//history对象，演示刷新
		window.history.go(0);
	</script>
	
  </body>
</html>






